package com.geetour.columbus.common.test.mysql;

import org.apache.commons.dbcp.BasicDataSource;
import org.dbunit.AbstractDatabaseTester;
import org.dbunit.database.IDatabaseConnection;

/**
 * Oracle Database Tester
 *
 * @author ChenKai
 * @since 2012-05-09
 */
public class MysqlIbatisSessionDatabaseTester extends AbstractDatabaseTester {

	private BasicDataSource dataSource;

	public MysqlIbatisSessionDatabaseTester(BasicDataSource dataSource,
			String schema) {
		super(schema);
		this.dataSource = dataSource;
	}

	public MysqlIbatisSessionDatabaseTester(BasicDataSource dataSource) {
		this.dataSource = dataSource;
	}

	@Override
	public IDatabaseConnection getConnection() throws Exception {
		return new MysqlDatabaseConnection(dataSource.getConnection(),
				getSchema());
	}

}
